<h2>DESCRIPTION</h2>

For basic information about GRASS <em>mapset</em>, <em>location</em>
and <em>data base</em> refer to <a href="helptext.html">GRASS
Quickstart</a>.

<p>
A <em>mapset</em> holds a distinct set of data layers, each relevant
to the same (or a subset of the same) geographic region, and each
drawn in the same map coordinate system.  At the outset of every GRASS
session, the user identifies a GRASS data base, location, and mapset
that are to be the user's <em>current data base</em>, <em>current
location</em>, and <em>current mapset</em> for the duration of the
session; any maps created by the user during the session will be
stored under the <em>current mapset</em> set at the session's outset
(see <em><a href="g.mapset.html">g.mapset</a></em> [without an "s"]
and <em><a href="g.gisenv.html">g.gisenv</a></em> for changing the
mapset with a session).

<p>
The user can add, modify, and delete data layers that exist under
their <em>current mapset</em>. Although the user can
also <em>access</em> (i.e., use) data that are stored under
<em>other</em> mapsets in the same GRASS location using the
<tt>mapname@mapsetname</tt> notation or mapset search path, the user
can only make permanent changes (create or modify data)
located in the <em>current mapset</em>.  The user's
<em>mapset search path</em> lists the order in which other mapsets in
the same GRASS location can be searched and their data accessed by the
user. The user can modify the listing and order in which these mapsets
are accessed by modifying the mapset search path; this can be done
using the <em>g.mapsets</em> command. This program allows the user to
use other's relevant map data without altering the original data
layer, and without taking up disk space with a copy of the original
map. The <tt>mapname@mapsetname</tt> notation may be used irrespective
of the mapset search path, i.e., any map found in another mapset with
sufficient <em><a href="g.access.html">g.access</a></em> privileges
may be called in such a manner.

<p>
<em>g.mapsets</em> shows the user available mapsets under the current
GRASS location, lists mapsets to which the user currently has access,
and lists the order in which accessible mapsets will be accessed by
GRASS programs searching for data files.  The user is then given the
opportunity to add or delete mapset names from the search path, or
modify the order in which mapsets will be accessed.

<p>
When the user specifies the name of a data base element file (e.g., a
particular vector map, raster map, <a href="i.group.html">imagery</a>
group file, etc.) to a GRASS program, the program searches for the
named file under each of the mapsets listed in the user's mapset
search path in the order listed there until the program finds a file
of the given name. Users can also specify a file by its mapset, to
make explicit the mapset from which the file is to be drawn; e.g., the
command:

<div class="code"><pre>
g.copy raster=soils@PERMANENT,my_soils
</pre></div>

ensures that a new file named <tt>my_soils</tt> is to be a copy of
the file <tt>soils</tt> from the mapset PERMANENT.

<p>
In each location there is the special mapset <b>PERMANENT</b> included
in the mapset search path, as this mapset typically contains base maps
relevant to many applications. Often, other mapsets which contain sets
of interpreted maps will be likewise included in the user's mapset search path.
Suppose, for example, that the mapset <em>Soil_Maps</em> contains
interpreted soils map layers to which the user wants access. The
mapset <em>Soil_Maps</em> should then be included in the user's
<em>search path</em> variable.

<p>
The <em>mapset search path</em> is saved as part of the current
mapset. When the user works with that mapset in subsequent GRASS
sessions, the previously saved mapset search path will be used (and
will continue to be used until it is modified by the user
with <em>g.mapsets</em>).

<h2>NOTES</h2>

By default <em>g.mapsets</em> adds to the current <em>mapset search
path</em> mapsets named by <b>mapset</b> option. Alternatively mapsets
can be removed (<b>operation=remove</b>) from the search path or
defined by <b>operation=set</b>.

<p>
Users can restrict others' access to their mapset files through use
of <em><a href="g.access.html">g.access</a></em>. Mapsets to which
access is restricted can still be listed in another's mapset search
path; however, access to these mapsets will remain restricted.

<h2>EXAMPLES</h2>

<h3>Selecting mapsets with the graphical mapset manager</h3>

Using the <b>-s</b> flag, a convenient graphical mapset manager can
be opened to select and deselect other mapsets (the actual mapset and
the PERMANENT mapset are always selected):

<div class="code"><pre>
g.mapsets -s
</pre></div>

<center>
<img src="g_mapsets_gui.png"><br>
</center>


<h3>Print available mapsets</h3>
All available mapsets in the current location can be printed out by

<div class="code"><pre>
g.mapsets -l

Available mapsets:
PERMANENT user1 user2
</pre></div>

<h3>Add new mapset</h3>

Add mapset 'user2' to the current mapset search path

<div class="code"><pre>
g.mapsets mapset=user2 operation=add
</pre></div>

The current mapset search path is changed accordingly

<div class="code"><pre>
g.mapsets -p

Accessible mapsets:
user1 user2
</pre></div>

<h3>Overwrite current search path</h3>

Overwrite current search path

<div class="code"><pre>
g.mapsets mapset=user1,PERMANENT operation=set
</pre></div>

<h3>Using shortcuts for search path</h3>

The current mapset can be defined by a shortcut &quot;.&quot; (dot)

<div class="code"><pre>
g.mapsets mapset=.,PERMANENT operation=set
</pre></div>

<i>Note:</i> The current mapset will be always included in the search
path on the first position even if you change its position or omit the
current mapset from the <b>mapset</b> option.

<div class="code"><pre>
g.mapsets -p

Accessible mapsets:
user1 PERMANENT
</pre></div>

<h2>SEE ALSO</h2>

<em>
  <a href="g.access.html">g.access</a>,
  <a href="g.copy.html">g.copy</a>,
  <a href="g.gisenv.html">g.gisenv</a>,
  <a href="g.list.html">g.list</a>,
  <a href="g.mapset.html">g.mapset</a>
</em>

<h2>AUTHOR</h2>

Michael Shapiro, U.S.Army Construction Engineering Research Laboratory<br>
Greg Koerper, ManTech Environmental Technology, Inc.<br>
Updated to GRASS 7 by Martin Landa, Czech Technical University in Prague, Czech Republic

<!--
<p>
<i>Last changed: $Date$</i>
-->
